package com.xinqi.controller;

import com.xinqi.dto.Result;
import com.xinqi.service.HelloService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author xin麒
 * @date 2023/8/10 20:08
 */
@Slf4j
@RestController
@RequestMapping("/hello")
@Api("测试模块")
public class HelloController {

    @Autowired
    private HelloService helloService;

    @GetMapping("/{count}")
    @ApiOperation("do count by helloService")
    public Result processForCount(@PathVariable("count") Long count) {
        return Result.ok(helloService.processForCount(count));
    }

    @GetMapping("/2/{count}")
    @ApiOperation("do count by helloService2")
    public Result processForCount2(@PathVariable("count") Long count) {
        return Result.ok(helloService.processForCount2(count));
    }

    @GetMapping("/3/{count}")
    @ApiOperation("do count by helloService3")
    public Result processForCount3(@PathVariable("count") Long count) {
        return Result.ok(helloService.processForCount3(count));
    }




}
